import React from 'react';
import type { GameActionType } from '../types';

interface GameActionsProps {
  onAction: (actionType: GameActionType) => void;
  isLoading: boolean;
}

const GameActions: React.FC<GameActionsProps> = ({ onAction, isLoading }) => {
  const actionButtons: { type: GameActionType; label: string; icon?: string; description: string }[] = [
    {
      type: 'meditate',
      label: '打坐修炼',
      description: '吸纳天地灵气，提升修为境界'
    },
    {
      type: 'explore',
      label: '探索秘境',
      description: '深入神秘之地，寻找稀有宝物'
    },
    {
      type: 'alchemy',
      label: '炼丹制药',
      description: '炼制珍贵丹药，增强自身实力'
    },
    {
      type: 'challengeDemon',
      label: '挑战心魔',
      description: '直面内心魔障，提升悟性境界'
    }
  ];

  return (
    <div className="game-actions">
      <h3>修仙行动</h3>
      <div className="action-buttons-grid">
        {actionButtons.map((button) => (
          <button
            key={button.type}
            className="action-button"
            onClick={() => onAction(button.type)}
            disabled={isLoading}
            title={button.description}
          >
            <span className="action-icon">{button.icon || '✨'}</span>
            <span className="action-label">
              {isLoading ? `${button.label}中...` : button.label}
            </span>
          </button>
        ))}
      </div>
    </div>
  );
};

export default GameActions;